package com.jic.member.controller.rest;

import java.util.List;
import java.util.Map;

import com.jic.common.base.vo.RestResult;
import com.jic.member.api.rest.MemberStatisticsApi;
import com.jic.member.request.MememberUserRequest;
import com.jic.member.response.MememberUserResponse;
import com.jic.member.service.MememberUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 名    称：MemberStatisticsController
 * 功    能：
 * 创 建 人：K.K
 * 创建时间：2020/11/29 15:45
 * 修 改 人：
 * 修改时间：
 * 说    明：
 * 版 本 号：
 */
@RestController
@RequestMapping("/api/user/statistics")
@Api(tags = {"会员统计接口"})
@Slf4j
public class MemberStatisticsController implements MemberStatisticsApi {

    @Autowired
    private MememberUserService memberUserService;

    @Override
    @ApiOperation(value = "统计注册用户数接口")
    @ResponseBody
    @RequestMapping(value = "/queryRegisteredCount")
    public RestResult<Map<String, Long>> queryRegisteredCount(MememberUserRequest request) {
        return memberUserService.queryRegisteredCount(request);
    }

    @Override
    public RestResult<List<MememberUserResponse>> queryRegistered(MememberUserRequest request) {
        return memberUserService.queryRegistered(request);
    }
}
